<?php


defined('_JEXEC') or die( 'Restricted access' );

class JElementType extends JElement {

	var	$_name = 'Type';

	function fetchElement($name, $value, &$node, $control_name) {
                global $mainframe;

		$db	=& JFactory::getDBO();

	$query = 'SELECT t.name AS text, t.id AS name '.
        ' FROM #__simplelisting_types as t WHERE t.published=1'
        ;
		$db->setQuery( $query );
		$options = $db->loadObjectList( );

               array_unshift($options, JHTML::_('select.option', '0', '- '.JText::_('Select Type').' -', 'name', 'text'));

      return JHTML::_('select.genericlist',  $options, ''.$control_name.'['.$name.']', 'class="inputbox"', 'name', 'text', $value, $control_name.$name );
   }
}
?>